<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>form练习</title>
    <style>
        .con{
            width: 500px;
            margin: 100px auto;
            background-color: #fff;
            text-align: left;
            padding: 50px;
        }
        body{
            background-color: #f7f7f7;
        }
        label{
            display: inline-block;
            border: burlywood;
            width: 80px;
            /* border: 1px solid; */
            text-align: right;
        }
        .btn{
            width: 200px;
            height: 60px;
            background: rgb(223, 189, 189);
            font-size: 16px;
            border:none;
            margin: 10px ;
        }
        ul{
            list-style: none;
        }
        .ul >li:nth-child(odd){
            list-style: none;
            background: fuchsia;
        }
        .ul >li:nth-child(even){
            background: pink;
        }
    </style>
        <script src="./jquery3.5.min.js"></script>
</head>
<body>
    <ul class="ul">
        <li>11</li>
        <li>22</li>
        <li>33</li>
        <li>44</li>
    </ul>
    <form action="setMes.java" method="GET">
        <div class="con">
        <label for="username">用户名:</label><input id="username" placeholder="请输入用户名" class="ipt" type="text" /><br>
        <label for="password">密码:</label><input id="psssword" placeholder="请输入密码" class="ipt" type="password" /><br>
        <label>性别:</label><input type="radio" checked="checked" value="0" name="gender" />男<input type="radio" value="1" name="gender" />女<br>
        <label>爱好:</label><input type="checkbox" checked  name="hobby"/>唱歌<input type="checkbox" checked name="hobby" />跳舞<br>
        <label>政治面貌:</label>
        <select>
            <option>党员</option>
            <option selected>团员</option>
            <option>党员</option>
        </select><br>
        <label>个人介绍:</label><br><textarea cols="60" rows="10" placeholder="请输入个人简介"></textarea><br>
        <input type="file"/>
        <br>
        <button type="javascript:;" class="btn">提交</button>
        <button type="javascript:;" class="button">提交</button>
    </div>
    </form>
    <script type="text/javascript">
        (function(){
            $('#username').val('11');
          let gender =$("input[name='gender'][checked]").val();
          console.log(gender);
          let hobby =$("input[name='hobby'][checked]")
          console.log(hobby);
          let arr = []
          hobby.each(function(){
              arr.push($(this).val())
          });
          console.log(arr)
          $('.btn').css({color:'#fff'})
        })();
        console.log( $('.btn'))
        $('.button').hover(function(){
            $(this).html("进来了");
        },function(){
            $(this).html('出去了');
        })
    </script>
</body>
</html>